| >>> (Bitwise Zero Fill, Shift Right) The Zero Fill, Shift Right operator is a strange but useful tool. It is used to shift the binary equivelant of the given integerial number the number of spaces given by the value (which can only be an integer) to the right of the operator. That is, the operator looks at the number which is given on the left of the operator as a 32 bit binary number. This binary number is shifted to the right according to the number (which can only be an integer) to the right of the operator, adding zeros to the left as the furthest numbers on the right are dropped. This new binary number is then converted to a decimal integer and returned as the result of the operation. It should be noted that the sign (whether negative or positive) of the given original integer doesn't matter - the integer will be treated as positive. syntax: numberOne >>> numberTwo EXAMPLE variableOne = 20 >>> 2; document.write("The new value is " + variableOne); The example shows a variable being declared that uses the zero fill shift right operator. The original number given is 20. This number is then converted to its 32 bit binary equivalent. It is then shifted to the right two places. The new number, which is an returned as an integer, is written to the screen with the document.write statement. The value of variableOne is now 5. |